package com.gpipe.tools;

/**
 * Created by user on 2017/11/5.
 */
public class ToolModelGetDistance {
    private String lac;
    private String longitude;
    private String latitude;
    private String ci;
    private String bts_name;
    private String cLongitude;
    private String cLatitude;
    private Double distance;

    public String toString(){
        return this.lac+"|"+this.ci+"|"+this.longitude+"|"+this.latitude+"|"+this.distance;
    }

    public ToolModelGetDistance(BaseAreaModel baseAreaModel,String cLongitude,String cLatitude){
        this.lac=baseAreaModel.getLac();
        this.ci=baseAreaModel.getCi();
        this.longitude=baseAreaModel.getLongitude();
        this.latitude=baseAreaModel.getLatitude();
        this.bts_name=baseAreaModel.getBts_name();
        this.cLongitude=cLongitude;
        this.cLatitude=cLatitude;
        setDistance(baseAreaModel.getLongitude(),baseAreaModel.getLatitude(),cLongitude,cLatitude);
    }

    public Double getDistance() {
        return distance;
    }

    public void setDistance(String longitude,String latitude,String cLongitude,String cLatitude) {
        if(longitude==null||latitude==null||cLongitude==null||cLatitude==null){
            this.distance=Double.parseDouble("-1");
        }else
        this.distance=GpipeInit.getDistance(longitude,latitude,cLongitude,cLatitude);
    }

    public String getLac() {
        return lac;
    }

    public void setLac(String lac) {
        this.lac = lac;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getCi() {
        return ci;
    }

    public void setCi(String ci) {
        this.ci = ci;
    }

    public String getBts_name() {
        return bts_name;
    }

    public void setBts_name(String bts_name) {
        this.bts_name = bts_name;
    }

    public String getcLongitude() {
        return cLongitude;
    }

    public void setcLongitude(String cLongitude) {
        this.cLongitude = cLongitude;
    }

    public String getcLatitude() {
        return cLatitude;
    }

    public void setcLatitude(String cLatitude) {
        this.cLatitude = cLatitude;
    }
}
